<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org" xmlns:fmt="http://java.sun.com/jsp/jstl/fmt">
<head>
    <meta charset="UTF-8">
    <title>MyPetStore</title>
    <link rel="Stylesheet" href="../css/jpetstore.css" type="text/css" media="screen"/>
</head>
<body>
<div th:replace="common/top">
</div>

<div id="Content">
    <div id="BackLink">
        <a th:href="@{'/catalog/category?categoryId='+${product.categoryId}}" th:text="'Return to '+${product.categoryId}">返回大类</a>
    </div>

    <div id="Catalog">

        <h2 th:text="${product.name}">product的name属性</h2>

        <table>
            <tr>
                <th>Item ID</th>
                <th>Product ID</th>
                <th>Description</th>
                <th>List Price</th>
                <th>&nbsp;</th>
            </tr>
            <tr th:each="item:${itemList}">
                <td id="td3">
                    <a id="aaa1" th:href="@{'/catalog/item?itemId='+${item.itemId}}" th:text="${item.itemId}">itemId</a>
                </td>
                <td id="td4" th:text="${item.product.productId}">productId</td>
                <td th:text="${item.attribute1!=null?item.attribute1:''}+' '+${item.attribute2!=null?item.attribute2:''}+' '+${item.attribute3!=null?item.attribute3:''}+' '+${item.attribute4!=null?item.attribute4:''}+' '+${item.attribute5!=null?item.attribute5:''}+' '+${item.product.name}">Description</td>
                <td>
                    <fmt:formatNumber th:text="${'$'+#numbers.formatDecimal(item.listPrice,0,'COMMA',2,'POINT')}"/>
                </td>
                <td>
                    <a class="Button" th:href="@{'/cart/addItemToCart?workingItemId='+${item.itemId}}">Add to Cart</a>
                </td>
            </tr>
<!--            <c:forEach var="item" items="${sessionScope.itemList}">-->
<!--                <tr>-->
<!--                    <td id="td3">-->
<!--                        <a id="aaa1" href="viewItem?itemId=${item.itemId}">${item.itemId}</a>-->
<!--                    </td>-->
<!--                    <td id="td4">-->
<!--                        ${item.product.productId}-->
<!--                    </td>-->
<!--                    <td>-->
<!--                        ${item.attribute1} ${item.attribute2} ${item.attribute3}-->
<!--                        ${item.attribute4} ${item.attribute5} ${sessionScope.product.name}-->
<!--                    </td>-->
<!--                    <td>-->
<!--                        <fmt:formatNumber value="${item.listPrice}" pattern="$#,##0.00" /></td>-->
<!--                    <td>-->
<!--                        <a class="Button" href="addItemToCart?workingItemId=${item.itemId}">Add to Cart</a>-->
<!--                    </td>-->
<!--                </tr>-->
<!--            </c:forEach>-->
            <tr>
                <td>
                </td>
            </tr>
        </table>

    </div>
</div>

<div th:replace="common/bottom">
</div>
</body>
</html>